import cv2
import numpy as np

fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter('./test.mp4', fourcc, 5.0, (640, 480))
camera = cv2.VideoCapture('D:\\data\\机场物流项目\\过机视频3.mp4')
ret, frame = camera.read()

while ret:
    frame.dtype = np.uint8
    frame = cv2.resize(frame, (640, 480))
    out.write(frame)
    ret, frame = camera.read()

out.release()
